(function(){"use strict";BX.namespace("BX.Landing.UI.Button");var t=BX.Landing.Utils.isPlainObject;var i=BX.Landing.Utils.isString;var n=BX.Landing.Utils.isFunction;var s=BX.Landing.Utils.isArray;var a=BX.Landing.Utils.assign;var o=BX.Landing.Utils.attr;var e=BX.Landing.Utils.setTextContent;var l=BX.Landing.Utils.escapeAttributeValue;var u=BX.Landing.Utils.append;var d=BX.Landing.Utils.addClass;var h=BX.Landing.Utils.removeClass;var r=BX.Landing.Utils.hasClass;var c=BX.Landing.Utils.Show;var B=BX.Landing.Utils.Hide;var g=BX.Landing.Utils.bind;BX.Landing.UI.Button.BaseButton=function(d,h){h=t(h)?h:t(d)?d:{};h=a({text:"",html:"",onClick:function(){},attrs:{},disabled:false,className:null},h);d=!!d&&i(d)?d:BX.Landing.UI.Button.BaseButton.makeId();this.id=d;this.options=h;this.loader=null;this.layout=BX.create("button",{props:{className:"landing-ui-button"},attrs:{type:"button"}});this.text=BX.create("span",{props:{className:"landing-ui-button-text"}});u(this.text,this.layout);o(this.layout,"data-id",l(this.id));if(i(this.options.html)&&!!this.options.html){this.text.innerHTML=this.options.html}else{e(this.text,this.options.text)}if(n(this.options.onClick)){this.on("click",this.options.onClick)}if(t(this.options.attrs)){this.setAttributes(this.options.attrs)}if(s(this.options.className)){this.options.className.forEach(this.layout.classList.add,this.layout.classList)}if(i(this.options.className)&&!!this.options.className){this.layout.classList.add(this.options.className)}if(this.options.active){this.activate()}if(this.options.disabled){this.disable()}};BX.Landing.UI.Button.BaseButton.makeId=function(){return"landing_ui_button_"+ +new Date};BX.Landing.UI.Button.BaseButton.prototype={setHtml:function(t){if(i(t)){this.text.innerHTML=t.trim()}},setText:function(t){if(i(t)){e(this.text,t)}},on:function(t,s,a){if(i(t)&&n(s)){g(this.layout,t,BX.proxy(s,a))}},setAttributes:function(t){o(this.layout,t)},setAttribute:function(t,i){o(this.layout,t,i)},disable:function(){d(this.layout,"landing-ui-disabled")},enable:function(){h(this.layout,"landing-ui-disabled");this.layout.removeAttribute("disabled")},isEnabled:function(){return!r(this.layout,"landing-ui-disabled")},show:function(){return c(this.layout)},hide:function(){return B(this.layout)},activate:function(){d(this.layout,"landing-ui-active")},deactivate:function(){h(this.layout,"landing-ui-active")},isActive:function(){return r(this.layout,"landing-ui-active")}}})();
//# sourceMappingURL=base_button.map.js